  <div class="pageheader">
      <h2><i class="fa fa-home"></i> Students </h2>
    </div>
    
    <div class="contentpanel">
       
      <div class="panel panel-default">
        <div class="panel-heading">
          <h4 class="panel-title"><strong>Add new Board, Class and Subject</strong></h4>		
        </div>
		 <form action="<?php echo site_url("teacher").'/'.$this->uri->segment(2); ?>/add_new_form" method="post" class="form-horizontal">
        <div class="panel-body panel-body">
			<div class="row">
			  <?php if($this->session->flashdata('message_board_added') !== false && $this->session->flashdata('message_board_added') == 1){
			?> <div class="alert alert-success fade in">
				<a href="#" class="close" data-dismiss="alert">&times;</a>
				<strong>Success!</strong> Data Submitted successfully.
			</div>
				<?php
			  } ?>
			  <?php if($this->session->flashdata('message_board_added') !== false && $this->session->flashdata('message_board_added') == 0){
			?> <div class="alert alert-warning fade in">
				<a href="#" class="close" data-dismiss="alert">&times;</a>
				<strong>Warning!</strong> No Data Added.
			</div>
				<?php
			  } ?>
			  
				<div class="col-md-4">
				  <h5 class="subtitle">Add New Board</h5>
				  <div  id="board_html">
					<div class="form-group">
						  <div class="col-sm-9">
								<input type="text" name="add_board[]" placeholder="Board name" class="form-control">						
						  </div>
						  <div class="col-sm-1"></div>
						  <div class="col-sm-2">
								<button type="button" class="btn btn-default" onclick="deleteParentElement(this.parentNode.parentNode)">
										<i class="fa fa-trash-o"></i>
								</button>
						   </div>
                    </div>
				  </div>
					 <button type="button" id="add_board_to" onclick="return add_board()" class="btn btn-warning btn-xs pull-right m-t-10"><i class="fa fa-plus"></i> Add more</button>
				</div><!-- col-md-4 -->
				<div class="col-md-4">
				  <h5 class="subtitle">Add New Class</h5>
					 <div  id="class_html">
						<div class="form-group">
							  <div class="col-sm-9">
									<input type="text" name="add_class[]" placeholder="Class name" class="form-control">						
							  </div>
							  <div class="col-sm-1"></div>
							  <div class="col-sm-2">
									<button type="button" class="btn btn-default" onclick="deleteParentElement(this.parentNode.parentNode)">
											<i class="fa fa-trash-o"></i>
									</button>
							   </div>
						</div>
					  </div>
					 <button type="button" id="add_class_to" onclick="return add_class()" class="btn btn-warning btn-xs pull-right m-t-10"><i class="fa fa-plus"></i> Add more</button>
				</div><!-- col-md-4 -->
				<div class="col-md-4">
				  <h5 class="subtitle">Add New Subject</h5>
				   <div  id="subject_html">
						<div class="form-group">
							  <div class="col-sm-9">
									<input type="text" name="add_subject[]" placeholder="Subject name" class="form-control">						
							  </div>
							  <div class="col-sm-1"></div>
							  <div class="col-sm-2">
									<button type="button" class="btn btn-default" onclick="deleteParentElement(this.parentNode.parentNode)">
											<i class="fa fa-trash-o"></i>
									</button>
							   </div>
						</div>
					  </div>
					 <button type="button" id="add_subject_to" onclick="return add_subject()" class="btn btn-warning btn-xs pull-right m-t-10"><i class="fa fa-plus"></i> Add more</button>
				</div><!-- col-md-4 -->
            
           </div>
			 		
			
        </div><!-- panel-body -->
        
        <div class="panel-footer">
			<div class="row">
				<div class="col-sm-6 col-sm-offset-3">
				  <button type="submit" class="btn btn-success">Submit</button>&nbsp;
				  <button class="btn btn-default">Cancel</button>
				</div>
			</div>
		</div><!-- panel-footer -->
          
	  	</form>
      </div><!-- panel -->
    </div><!-- contentpanel -->
	    
  </div><!-- mainpanel -->
 
  
</section>


<script src="<?php echo base_url();?>adm/js/jquery-1.10.2.min.js"></script>
<script src="<?php echo base_url();?>adm/js/jquery-migrate-1.2.1.min.js"></script>
<script src="<?php echo base_url();?>adm/js/jquery.cookie.js"></script>
<script src="<?php echo base_url();?>adm/js/bootstrap.min.js"></script>
<script src="<?php echo base_url();?>adm/js/modernizr.min.js"></script>
<script src="<?php echo base_url();?>adm/js/jquery.sparkline.min.js"></script>
<script src="<?php echo base_url();?>adm/js/toggles.min.js"></script>
<script src="<?php echo base_url();?>adm/js/retina.min.js"></script>
<script src="<?php echo base_url();?>adm/js/jquery.cookies.js"></script>

<script src="<?php echo base_url();?>adm/js/jquery.datatables.min.js"></script>
<script src="<?php echo base_url();?>adm/js/chosen.jquery.min.js"></script>

<script src="<?php echo base_url();?>adm/js/custom.js"></script>
<script>
	var board_html = '';
	function add_board()
	  {
		jQuery('#board_html').append(board_html);
	  }
	  
	var class_html = '';
	function add_class()
	  {
		jQuery('#class_html').append(class_html);
	  }
	  
	var subject_html = '';
	function add_subject()
	  {
		jQuery('#subject_html').append(subject_html);
	  }
	  
  // REMOVING INVOICE ENTRY
	function deleteParentElement(n){
		n.parentNode.removeChild(n);
	}
  jQuery(document).ready(function() {
    
	board_html = jQuery('#board_html').html();
	class_html = jQuery('#class_html').html();
	subject_html = jQuery('#subject_html').html();
   
	jQuery('#table1').dataTable();
    
    jQuery('#table2').dataTable({
      "sPaginationType": "full_numbers"
    });
    
    // Chosen Select
    jQuery("select").chosen({
      'min-width': '100px',
      'white-space': 'nowrap',
      disable_search_threshold: 10
    });
    
    // Delete row in a table
    jQuery('.delete-row').click(function(){
      var c = confirm("Continue delete?");
      if(c)
        jQuery(this).closest('tr').fadeOut(function(){
          jQuery(this).remove();
        });
        
        return false;
    });
    
    // Show aciton upon row hover
    jQuery('.table-hidaction tbody tr').hover(function(){
      jQuery(this).find('.table-action-hide a').animate({opacity: 1});
    },function(){
      jQuery(this).find('.table-action-hide a').animate({opacity: 0});
    });
  
  
  });
  
</script>

</body>
</html>